class Windows {
				
	static String getSideBar(String user){
		String newpost = '';
		
		if(user != null && !(user == ""))
			newpost = 'NEW POST';
			
		String bar =  '<div id = "buttons" class="well" style="padding: 8px 0;">'+
							'<ul class="nav-list">'+
								'<li class="" id="MakePost" ><a href="#" id = "newpostbtn">$newpost</a></li>'+
								'<li class="active" id="allposts"><a href="#">ALL POSTS</a></li>'+
								'<li class="" id="filterByUser"><a href="#">BY USER</a></li>'+
								'<li class="" id="filterByDates"><a href="#">BY DATES</a></li>'+
								'<li class="" id="filterByTags"><a href="#">BY TAGS</a></li>'+
							'</ul>'+
						'</div>';
						
		return bar;
	}
  
  static String makeNewPost =	'<div class="modal">'+
									'<div class="modal-body">'+
										'<h4>Title</h4>'+
										'<textarea class="input-xlarge" id="titleTxt" rows="1"></textarea>'+
										'<br>'+
										'<h4>Post</h4>'+
										'<textarea class="input-xlarge" id="contentTxt" rows="7"></textarea>'+
										'<br>'+
										'<h4>Tags</h4>'+
										'<textarea class="input-xlarge" id="tags" rows="1"></textarea>'+
									'</div>'+
									 '<div id = "errortags" style = "padding-left:30px;color:red"></div>' +
									'<div class="modal-footer">'+
										 '<a href="#" class="btn" id="cancelPost">Cancel</a>'+
										 '<a href="#" class="btn btn-primary" id="addPost">Post</a>'+
									'</div>'+
								'</div>' ;
  
  static String showPostsByTag =  '''<div class="modal" id="GetByTagsWindow" align="center">
										<div class="modal-header">
											<h3>POSTS BY TAGS</h3>
										</div>
										<div class="modal-footer">
											<h5 class = "dates">select tags</h5>
											<ul class="breadcrumb" id="tagsToShowToUser">		
												<li class="active" id="' + _tags[i] + '">
													<a href="#">No tags</a><span class="divider">/</span>
												</li>				
											</ul>
											<a href="#" class="btn" id="cancelGetByTags">Cancel</a>
											<a href="#" class="btn btn-primary" id="GetByTags">Get</a>
										 </div>
									</div>''';
								  
								  
	static String singInForm =  '''<div class="singform">
										<input class="input-small" type="text" id = "signin" placeholder="Username">
										<button class="btn" type="submit" id = "signbtn">Sign in</button>
									</div>''';
		
	static String signOutForm(String username) => 	'<div class="singform" style = "margin-left:15px">'+
														'<button class="btn" type="submit" id = "signbtn">Sign Out</button>'+
													'</div>'+
													'<p class="pull-right">Logged in as <a href="#">$username</a></p>';

	static String months = 	'''<option value = 1>Jan</option>
                							<option value = 2>Feb</option>
                							<option value = 3>Mar</option>
                							<option value = 4>Apr</option>
                							<option value = 5>May</option>
                							<option value = 6>Jun</option>
                							<option value = 7>Jul</option>
                							<option value = 8>Aug</option>
                							<option value = 9>Sep</option>
                							<option value = 10>Oct</option>
                							<option value = 11>Nov</option>
                							<option value = 12>Dec</option>''';
							
							
	static String getDates(){
		String dates = '';
		for(num i = 1; i <= 31; i++){
			dates += '<option value = $i>$i</option>\n';
		}
		return dates;
	}
	
	static String getTime(){
		String times = '';
		for(num i = 0; i < 24; i++){
			String hour = '';
			if(i/10 < 1)
				hour = '0' + i;
			else
				hour = i.toString();
			for(num j = 0; j < 60; j+=20){
				String minutes = '';
				if(j/10 < 1)
					minutes = '0' + j;
				else
					minutes = j.toString();
					
				times += '<option value = $hour:$minutes>$hour:$minutes</option>\n';
			}
		}
		return times;
	}
	
	
	static String getYears(){
		String years = '';
		for(num i = 2000; i <= 2012; i++){
		  years += '<option value = $i>$i</option>\n';
		}
		return years;
	}
	
	
	static String getCalendar(){
		   return '''<div class="modal-header"> 
						<h3>SELECT DATES</h3>
					</div>
					<div class="modal-footer">
					<ul class="breadcrumb">
					  <table>
					   <tr>
						<td class = "dates">select start date</td>
						<td class = "dates">select end date</td>
					   </tr>
					   <tr>
						<td>
							<select class="mediumSelect" name="mediumSelect" id="startMonth">''' +
								months +		
						'''</select>
							  <select class="mediumSelect" name="mediumSelect" id="startDay">'''+
								getDates() +
						'''</select>
							  <select class="mediumSelect" name="mediumSelect" id="startYear">'''+
								getYears() +
						'''</select>
						</td>
						<td>
							<select class="mediumSelect" name="mediumSelect" id="endMonth">''' +
								months +		
						'''</select>
							  <select class="mediumSelect" name="mediumSelect" id="endDay">'''+
								getDates() +
						'''</select>
							  <select class="mediumSelect" name="mediumSelect" id="endYear">'''+
								getYears() +
						'''</select>
						</td>
					   </tr>
					   <tr><td colspan = "2"><div id = "errordates" style = "color: red;"></div></td></tr>
					  </table>	 
					</ul>
						 <a href="#" class="btn" id="cancelGetByDates">Cancel</a>
						 <a href="#" class="btn btn-primary" id="getByDates">Get</a>
					</div>''';
	
	}

	static String getByUsersWindow(){
			return '''<div class="modal" id="GetByTagsWindow" style="width:500px;" align = "center">	
						<div class="modal-header"> 
							<h3>POSTS BY USER</h3>
						</div>
						<div class="modal-footer">
							 
						<ul class="breadcrumb" id="tagsToShowToUser" >
						  <table>
							   <tr>
								<td class = "dates"><center>insert user name</center></td>
							   </tr>
							   <tr> 
									<td>
										<center><div class="clearfix"><input class="span5" id="byuserfield" name="" type="text" placeholder="username" /></div></center>
									</td>
								</tr>
						</table>	 
						 </ul>
						 <a href="#" class="btn" id="cancelByUsers">Cancel</a>
						 <a href="#" class="btn btn-primary" id="getByUsers">Get</a>
						</div>
					</div>''';
	}

}
